﻿using System;
using NetServ.Net.Json;

namespace Ria.Infrastructure
{
    class Person
    {
        public string Name { get; set; }
        public DateTime Dob { get; set; }
        public int Kids { get; set; }

        public JsonObject ToJsonObject()
        {
            return new JsonObject
                       {
                           {"name", Name},
                           {"dob", Dob.ToString(DemoDataServices.FlexDateFormat)},
                           {"kids", Kids}
                       };
        }

        public string ToJsonString()
        {
            return ToJsonObject().ToJsonString();
        }
    }
}
